import {FrameAdapter} from "./war3Adapter/model1/FrameAdapter";
import {frameAdapter} from "./adapterInterface/model1/IFrameAdapter";
import {globalAdapter} from "./adapterInterface/model1/IGlobalAdapter";
import {GlobalAdapter} from "./war3Adapter/model1/GlobalAdapter";
import {localSaveAdapter} from "./adapterInterface/model1/ILocalSaveAdapter";
import {LocalSaveAdapter} from "./war3Adapter/model1/LocalSaveAdapter";
import {timeAdapter} from "./adapterInterface/model2/ITimerAdapter";
import {TimerAdapter} from "./war3Adapter/model2/TimerAdapter";
import {effectAdapter} from "./adapterInterface/model2/IEffectAdapter";
import {EffectAadapter} from "./war3Adapter/model2/EffectAadapter";
import {textAdapter} from "./adapterInterface/model2/ITexttagAdapter";
import {TexttagAdapter} from "./war3Adapter/model2/TexttagAdapter";
import {itemAdapter} from "./adapterInterface/model3/IItemAdapter";
import {ItemAdapter} from "./war3Adapter/model3/ItemAdapter";
import {playerAdapter} from "./adapterInterface/model4/IPlayerAdapter";
import {PlayerAdapter} from "./war3Adapter/model4/PlayerAdapter";
import {rectAdapter} from "./adapterInterface/model2/IRectAdapter";
import {RectAdapter} from "./war3Adapter/model2/RectAdapter";
import {triggetAdapter} from "./adapterInterface/model4/ITriggerAdapter";
import {TriggerAdapter} from "./war3Adapter/model4/TriggerAdapter";
import {unitAdapter} from "./adapterInterface/model3/IUnitAdapter";
import {UnitAdapter} from "./war3Adapter/model3/UnitAdapter";
import {modelAdapter} from "./adapterInterface/model5/IModelFactory";
import {ModelAdapter} from "./war3Adapter/model5/ModelAdapter";
import {mathAdapter} from "./adapterInterface/util/IMathAdapter";
import {MathAdapter} from "./war3Adapter/util/IMathAdapter";

enum AdapterType {
    war3,
    cocos,
}

const adapterType: AdapterType = AdapterType.war3;

export class AdapterFactory {
    static adapterFactory = new AdapterFactory();

    static getInstance () {
        return AdapterFactory.adapterFactory;
    }

    constructor() {
        if (adapterType === AdapterType.war3) {
            mathAdapter.adapter = new MathAdapter();
            globalAdapter.adapter = new GlobalAdapter();
            frameAdapter.adapter = new FrameAdapter();
            localSaveAdapter.adapter = new LocalSaveAdapter();
            timeAdapter.adapter = new TimerAdapter();
            effectAdapter.adapter = new EffectAadapter();
            textAdapter.adapter = new TexttagAdapter();
            itemAdapter.adapter = new ItemAdapter();
            rectAdapter.adapter = new RectAdapter();
            playerAdapter.adapter = new PlayerAdapter();
            triggetAdapter.adapter = new TriggerAdapter();
            unitAdapter.adapter = new UnitAdapter();
            modelAdapter.adapter = new ModelAdapter();
        }
    }

    init() {

    }
}